
package nasif.cn.imagewikis.ao.api;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import nasif.cn.imagewikis.dao.PictureMapper;
import nasif.cn.imagewikis.entity.Picture;
import nasif.cn.imagewikis.entity.PictureExample;

import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class PictureHttpApiService {
	@Resource
	protected PictureMapper pictureMapper;
	public List<Picture> getPageNo(Integer pageNo){
		List<Picture> list = new ArrayList<Picture>();
		try {
			PictureExample example = new PictureExample();
			example.setPageNo(pageNo.longValue());
			list = pictureMapper.selectByExample(example);
			return list;
		} catch (Exception e) {
			LoggerFactory.getLogger(this.getClass()).error(e.getMessage());
		}
		return list;
	}
	public void add(Picture picture) {
		pictureMapper.insert(picture);
	}
}
